﻿@{
    if (!Check.CheckLogin(false) || !Check.CheckUrl())
    {
        Response.Write("验证错误!");
        Response.End();
    }

    string flowid = Request.QueryString["flowid1"];
    string groupid = Request.QueryString["groupid"];

    Guid fid, gid;
    if (flowid.IsGuid(out fid) && groupid.IsGuid(out gid))
    {
        System.Text.StringBuilder delxml = new System.Text.StringBuilder();
        var tasks = new Business.Platform.WorkFlowTask().GetTaskList(fid, gid);
        foreach(var task in tasks)
        {
            delxml.Append(task.Serialize());
        }
        new Business.Platform.WorkFlowTask().DeleteInstance(fid, gid);
        Business.Platform.Log.Add("管理员删除了流程实例", delxml.ToString(), Business.Platform.Log.Types.流程相关);
        Response.Write("删除成功!");
        Response.End();
    }
    else
    {
        Response.Write("参数错误!");
        Response.End();
    }
}